<template>
  <div class="main"></div>
</template>

<script>
import storage from 'store'
export default {
  data () {
    return {
    }
  },
  created () {
  },
  mounted () {
    if (window.location.href.indexOf('token') >= 0) {
      const token = this.GetRequest()
      storage.set('Access-Token', token, 7 * 24 * 60 * 60 * 1000)
      this.$store.commit('SET_TOKEN', token)
    }
  },
  methods: {
    GetRequest () {
      let url = window.location.href
      let theRequest = {}
      if (url.indexOf('?') !== -1) {
        url = url.split('?')
        const str = url[1].substr(6)
        theRequest = str
      }
      return theRequest
    }
  }
}
</script>

<style lang="less" scoped>
</style>
